wee hours of the A.M.

Translations
ранние часы утра
He was studying until the wee hours of the A.M.
Он учился до ранних часов утра.
Definitions
The early hours of the morning, typically referring to the time between midnight and dawn, when most people are asleep.